package cn.yy.common.web;

/**
 * 统一响应状态码
 */
public enum MessageStatus {
    /* 成功状态码（默认） */
    SUCCESS(1, "success"),
    /* 失败状态码（默认） */
    ERROR(2, "error"),

    /* 参数错误：10001-19999 */
    PARAM_IS_INVALID(10001, "参数无效"),
    PARAM_IS_BLANK(10002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(10003, "参数类型错误"),
    PARAM_NOT_COMPLETE(10004, "参数缺失"),
    PARAM_TELEPHONE_FORMAT_ERROR(10005,"电话格式有误"),
    PARAM_VERIFY_CODE_NOT_EXIST(10006,"验证码不存在"),
    PARAM_VERIFY_CODE_NOT_MATCH(10007,"验证码有误"),



    /* 用户错误：20001-29999*/
    USER_TOKEN_NOT_EXIST(20001, "用户未登录"),
    USER_TOKEN_INVALID(20002, "token无效"),
    USER_TOKEN_CHECK_FAIL(20003, "token远程认证失败"),
    USER_LOGIN_ERROR(20004, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(20005, "账号已被禁用"),
    USER_NOT_EXIST(20006, "用户不存在"),
    USER_HAS_EXISTED(20007, "用户已存在"),
    USER_NOT_EMPTY(20008, "用户名不能为空"),

    /* 业务错误：30001-39999 */
    SPECIFIED_QUESTIONED_ERROR(30001, "业务逻辑出现问题"),
    SPECIFIED_QUESTIONED_GET_TOKEN_ERROR(30002, "非法获取token"),

    /* 系统错误：40001-49999 */
    SYSTEM_INNER_ERROR(40001, "系统内部错误，请稍后重试"),
    UPLOAD_FILE_ERROR(40002,"上传文件异常"),
    UPLOAD_FILE_EMPTY(40003,"上传文件为空"),
    UPLOAD_IMAGE_NO(40004,"上传的不是图片"),
    UPLOAD_TYPE_ERROR(40005,"上传类型配置有误，只能是local或remote"),
    RECOVER_TYPE_ERROR(40006,"数据恢复的配置有误，只能是local或remote"),
    EVALUATE_DATASET_ERROR(40007,"评估数据集中分类必须和训练保持一致"),

    /* 数据错误：50001-599999 */
    DATA_NONE(50001, "数据未找到"),
    DATA_WRONG(50002, "数据错误"),
    DATA_EXISTED(50003, "数据已存在"),
    DATA_NAME_CONTAIN_CHINESE(50004, "名称包含中文"),
    FILE_DIR_FORMAT_ERROR(50005,"压缩文件目录格式不正确"),
    FILE_TYPE_ERROR(50006,"上传文件类型不符合规范"),

    /* 接口错误：60001-69999 */
    INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常"),
    INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常"),
    INTERFACE_FORBID_VISIT(60003, "该接口禁止访问"),
    INTERFACE_ADDRESS_INVALID(60004, "接口地址无效"),
    INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时"),

    /* 权限错误：70001-79999 */
    PERMISSION_NOT_ADMIN(70001, "当前用户不是管理员"),
    PERMISSION_NO_ACCESS(70002, "无访问权限");





    private Integer code;

    private String message;

    MessageStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }
}
